<div style="position: relative; width: 300px">
    <span style="display: inline; background-color: green">lorem</span>
    <div style="background-color: red; float: right">ipsum</div>
</div>